// To parse this JSON data, do
//
//     final userInfo = userInfoFromJson(jsonString);

import 'package:freezed_annotation/freezed_annotation.dart';
import 'dart:convert';

part 'userinfo.freezed.dart';
part 'userinfo.g.dart';

UserInfo userInfoFromJson(String str) => UserInfo.fromJson(json.decode(str));

String userInfoToJson(UserInfo data) => json.encode(data.toJson());

@freezed
class UserInfo with _$UserInfo {
  const factory UserInfo({
    @JsonKey(name: "accessToken") String? accessToken,
    @JsonKey(name: "tokenType") String? tokenType,
    @JsonKey(name: "refreshToken") String? refreshToken,
    @JsonKey(name: "userId") String? userId,
    @JsonKey(name: "tenantId") String? tenantId,
    @JsonKey(name: "avatar") String? avatar,
    @JsonKey(name: "roleId") String? roleId,
    @JsonKey(name: "roleName") String? roleName,
    @JsonKey(name: "deptId") String? deptId,
    @JsonKey(name: "deptName") String? deptName,
    @JsonKey(name: "userName") String? userName,
    @JsonKey(name: "account") String? account,
    @JsonKey(name: "expiresIn") int? expiresIn,
  }) = _UserInfo;

  factory UserInfo.fromJson(Map<String, dynamic> json) =>
      _$UserInfoFromJson(json);
}
